
set more off
clear

use stmerge.dta, clear

merge 1:m fips year using cs-recode.dta, gen(mgpew)

	
*----------------------------------------------------------*
* Additional recodes                                       *
*----------------------------------------------------------*
replace partyid=partyid-3
gen r_race = r_white*1 + r_black*2 + r_hisp*3 + r_asian*4
replace r_race = 5 if r_race==0
label define racelab 1 "White" 2 "Black" 3 "LatinX" 4 "Asian" 5 "Other"
label values r_race racelab

drop if year < 1997

	

	label var pct_ba "Pct. 4-Year Degree"
	label var pct_hsgrad "Pct. HS Grad"
	label var unemployment "Unemployment Rate"
	label var percapincreal "Personal Income (per capita)"
	label var r_male "Male"
	label var r_age "Age"
	label var r_educ "Education"
	label var r_income "Income"
	label var r_black "Black"
	label var r_hisp "Hispanic"
	label var r_asian "Asian"
	label var partyid "Party ID (R=-, I=0, D=+)"
	label var unified_gov "Unified Gov (R=-1, D=1)"
	label var pc "Partisan Advantage in Leg (R=-, D=+)"
	label var cshouse "Constituency Size"
	label var lncs "Constituency Size (log)"
	label var debt_net_pc_real "Long Term Debt (per capita)"
	label var pct_black "Proportion Black in State"
	label var pct_hisp "Proportion Latinx in State"
	label var pct_rural "Proportion Rural in State"
	label var mds1 "Legislative Professionalism - 1st Dim"
	label var mds2_abs "Legislative Professionalism - 2nd Dim"
	label var hou_majority "Ideology of House Majority Party"
	label var policy "Policy Liberalism"
	label var size_low "Number of Seats in Lower Chamber"
	label var lnpop "Population Size (log)"
	

	recode partyid (-2 -1 = -1 )(0=0)(1 2 =1), gen(party3)
					
	gen r_age2=r_age*r_age

	tab year, gen(y)

save cs-recode.dta, replace
